package com.zhima.handler;

import com.zhima.dto.FeignJudgeRecordDTO;
import com.zhima.dto.FeignQuestionJudgeInfoDTO;
import com.zhima.enums.JudgerTypeEnums;

public abstract class AbstractJudgerHandler {
    /**
     * 子类返回自己的评测机类型
     *
     * @return
     */
    public abstract JudgerTypeEnums getJudgerType();

    /**
     * 处理测评请求
     *
     * @param feignJudgeRecordDTO
     * @param feignQuestionJudgeInfoDTO
     * @throws InterruptedException
     */
    public abstract void handle(FeignJudgeRecordDTO feignJudgeRecordDTO, FeignQuestionJudgeInfoDTO feignQuestionJudgeInfoDTO) throws InterruptedException;

    /**
     * 编译用户代码
     *
     * @param feignJudgeRecordDTO
     * @param feignQuestionJudgeInfoDTO
     * @return
     */
    public abstract boolean compile(FeignJudgeRecordDTO feignJudgeRecordDTO, FeignQuestionJudgeInfoDTO feignQuestionJudgeInfoDTO);
}
